When processing 3D graphics, a scene to be displayed is typically split into a number of basic components called “primitives” in order to allow the 3D graphics processing operations to be more readily carried out. The primitives are usually in the form of simple polygons, such as triangles.
Each primitive is typically defined by the vertices that make up the primitive, and each vertex will have associated with it particular data values representing the primitive at the vertex position, for example the X and Y position of the vertex, a depth (Z) value, colour and transparency values, etc. Within the graphics processing system, a primitive setup stage is performed that uses the data defined for each vertex of a given primitive in order to determine a plurality of functions for that primitive, such as edge functions that represent the geometric edges of the primitive, and a depth function used to determine a depth value at any particular point within the primitive (these edge and depth functions also being referred to as edge and depth equations herein). The primitive setup stage may also determine other functions such as interpolation functions that represent the way that the data values such as the colour values will vary across the primitive.
Following the primitive setup stage, a graphics primitive will be passed through a rasterization stage, where a rasterization operation is performed in order to determine a plurality of graphics fragments to be used to represent that graphics primitive, the rasterization operation determining the X and Y positions of each of those graphics fragments. Following rasterization, the graphics fragments are then passed through a rendering stage where the graphics fragments are subjected to colouring operations, shading operations, etc., in order to generate an output for display on a display screen.
Each graphics fragment (data element) may correspond to a single pixel (picture element) in the final display, or it can be the case that there is not a one-to-one correspondence between fragments and display pixels, for example where particular forms of post-processing such as down-scaling are carried out on the rendered image prior to displaying the final image.
It is known within the rasteriser to employ a multi-level patch analysis process in order to determine the graphics fragments that need to be generated for each input primitive. In accordance with such a technique, at a first level the render output area (e.g. a tile in a tile-based rendering system, or the entire frame in an immediate mode rendering system) is divided into one or more patches, and then at each subsequent level the render output area is subdivided into a plurality of patches smaller than the patches of the preceding level. Each patch has an array of grid points defining boundaries of a set of sub-patches within that patch. At each level, starting with the first level, the edges of the primitive are tested against the grid points to detect whether the grid points are inside or outside of the primitive, and hence determine which of the sub-patches are at least partially covered by the primitive (i.e. which sub-patches are entirely or partly inside the boundaries of the primitive). For any sub-patches that are at least partially covered by the primitive, the patch analysis process can then transfer to a lower level, where those sub-patches are treated as patches to be analysed at that lower level.
Such a process can in many instances provide an efficient mechanism for determining the graphics fragments that need to be generated for each input primitive. However, where an input primitive occupies a relatively small area within the render output area, such a process will become inefficient.
Accordingly, it would be desirable to provide a more efficient mechanism for performing a multi-level patch analysis in such situations.